﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Truextend.Training.Dao.Core.SqlServer
{
    /// <summary>
    /// Contains implementation of Context
    /// </summary>
    public class Context : IContext
    {
        private static Context instance;

        private static DaoService daoServiceInstance;

        /// <summary>
        /// Singleton for access to Context
        /// </summary>
        public static Context GetContext()
        {
            if (instance == null)
            {
                instance = new Context();
            }
            return instance;
        }


        #region IContext Members

        public IErrorService GetErrorService()
        {
            throw new NotImplementedException();
        }

        public ILoggingService GetLogger()
        {
            throw new NotImplementedException();
        }

        public IDaoService GetDaoService()
        {
            if (daoServiceInstance == null)
            {
                daoServiceInstance = new DaoService();
            }
            return daoServiceInstance;
        }

        #endregion

       
    }
}
